package com.syq.controller;

import com.syq.annotation.RequiresPermissionsDesc;
import com.syq.pojo.DtsCollect;
import com.syq.service.DtsCollectService;
import io.swagger.models.auth.In;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: AdminCollectionController
 * @Description: TODO
 * @Create by: syq
 * @Date: 2022/7/28 16:21
 */

@CrossOrigin
@RestController
@RequestMapping("/admin/collect")
public class AdminCollectionController {

    @Autowired
    private DtsCollectService dtsCollectService;

    @RequiresPermissionsDesc(menu = {"用户管理","收藏"},button = "查询")
    @RequiresPermissions(value = "admin:collect:list")
    @GetMapping("/list")
    public Object list(@RequestParam(defaultValue = "1")Integer page,
                       @RequestParam(defaultValue = "10")Integer limit, Integer userId, Integer valueId,
                       @RequestParam(defaultValue = "add_time")String sort,
                       @RequestParam(defaultValue = "desc")String order){
        return dtsCollectService.findAll(page, limit, userId, valueId, sort, order);
    }
}
